#include <iostream>
using namespace std;
int main()
{
    int N1,N2;
    int a1[20],a2[20];
    cin >> N1;
    for(int i = 0; i<N1; i++)
        cin>>a1[i];
    cin >> N2;
    for(int i = 0; i<N2; i++)
        cin>>a2[i];
    
    int N3 = 0;
    int a3[40];
    for(int i = 0; i < N1; i++)
    {
        bool bIfFind = false;
        for(int j = 0; j < N2; j++)
        {
            if(a1[i] == a2[j] )
            {
                bIfFind = true;
                break;
            }
        }
        if(!bIfFind)
        {
            int temp = a1[i];
            bool bIfRepeat = false;
            for(int k = 0; k< N3; k++)
            {
                if(a3[k] == temp)
                {
                    bIfRepeat =  true;
                    break;
                }
            }
            if(!bIfRepeat)
            {
                a3[N3] = temp;
                N3 = N3 + 1;
            }
        }
    }
    for(int i = 0; i < N2; i++)
    {
        bool bIfFind = false;
        for(int j = 0; j < N2; j++)
        {
            if(a2[i] == a1[j] )
            {
                bIfFind = true;
                break;
            }
        }
        if(!bIfFind)
        {
            int temp = a2[i];
            bool bIfRepeat = false;
            for(int k = 0; k< N3; k++)
            {
                if(a3[k] == temp)
                {
                    bIfRepeat =  true;
                    break;
                }
            }
            if(!bIfRepeat)
            {
                a3[N3] = temp;
                N3 = N3 + 1;
            }
        }
    }
    cout<<a3[0];
    for(int i = 1; i < N3; i++)
        cout<<" "<<a3[i];
    
}